#ifndef RCC_H
#define RCC_H

#include <QByteArray>
#include <QIODevice>

class ResourceFileInfo;

class ResourceMaker
{
public:
    ResourceMaker();
    ~ResourceMaker();
public:
    void writeNumber2(quint16 number);
    void writeNumber4(quint32 number);
    void writeChar(char c) { m_out.append(c); }
    void writeByteArray(const QByteArray &);
    void write(const char *, int len);
    void addData(QString path,const QByteArray &a);
public:
    QByteArray save();
protected:
    bool writeHeader();
    bool writeDataBlobs();
    bool writeDataNames();
    bool writeDataStructure();
    bool writeInitializer();

    void    addData(ResourceFileInfo *r,QString path,const QByteArray &a);
protected:
    QByteArray m_out;

    ResourceFileInfo *m_root;
    int m_treeOffset;
    int m_namesOffset;
    int m_dataOffset;
};

#endif
